<template name="page-header">
	<view>
		<view class="status_bar">  
			<view class="top_view"></view>  
		</view>  
		<view class="header">
			<view class="headerCon">
				<view><text @click="goBack" class="iconfont icon-left" v-if="headInfo.type != 0"></text></view>
				<view><text>{{headInfo.title}}</text></view>
				<view></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "page-header",
		props: {
			headInfo: {
				type: Object,
				default() {
					return []
				}
			},
		},
		data() {
			return {}
		},
		methods:{
			// 返回上一页
			goBack(){
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss">
	.status_bar {
		height: var(--status-bar-height);  
		width: 100%;  
		background: #fff;
	}  
	.top_view {  
		height: var(--status-bar-height);  
		width: 100%;  
		position: fixed;  
		background: #fff;  
		top: 0;  
		z-index: 999;
	}
	
	.headerCon{
		height: 96upx;
		line-height: 96upx;
		display: flex;
		width: 100%;
		background: #fff;
		view{flex:1;text-align: center;}
		view:nth-child(1){
			text-align: left;
			text{
				font-size: 38upx;
				padding: 30upx 20upx;
			}
		}
	}
</style>
